<%--
 *  File:    HospitalSummary.jsp
 *  @Author: KevinFan
 *  Date:    2011/15/22
 *
 *  Copyright (C) 2000 - 2020 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
 
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="http://dcms.oval.com/page/dcms" prefix="dcms" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  Category cat = Category.getInstance("jsp.HospitalSummary");
  String privilegeCode = "10320";
  String strModuleName = "ERM";
  String strTableName = "v_hospitalsummary";
  String contextPath = request.getContextPath();
%>

<%@include file="/inc/PageDefault.inc"%>
<%@include file="/inc/FrmDefault.inc"%>
<%@include file="/inc/LocationDefault.inc"%>
<%@ include file="/inc/NewCalendar.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>
<html>
<head>
<title>hospitalsummary</title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/summary.css" type="text/css">
<LINK href="<%=request.getContextPath()%>/css/<%=strLanguageCode%>/main.htm" type="text/css">
<script language="JavaScript" src="<%=request.getContextPath()%>/js/ScriptLib.js"></script>

<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>

<script>
<%
HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
Integer employeeid=(Integer)CurUserInfo.get("userid");

String  isadmin=(String)CurUserInfo.get("isadmin");
String  isregion=(String)CurUserInfo.get("isregion");
if(isadmin==null) isadmin="";
%>
function page_export(){
	var employeename=document.__otherSearchConditionForm.employeename.value;
	//if(employeename=="" || employeename==null)employeename=-1;
	var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	//var val = obj.options[index].text;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	//alert(document.__otherSearchConditionForm.regioncode.value);
	var regioncode=document.__otherSearchConditionForm.regioncode.value;   
<%-- if(!isEmpty(regioncode)){
	if(!isEmpty(__searchvalue)){

	   <%if("Y".equals(isadmin)){%>
       window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
       <%}else{%>
       window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
       <%}%>
	}else{
	    //alert("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
	    
	    <%if("Y".equals(isadmin)){%>
		window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
	   	<%}else{%>
	   	window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
	   	<%}%>
	}
 }else{
	alert("<%= message.getMessageDesc("REGION_NOT_NULL")%>");
	page_selectProvince();
 }
 --%>
   <%if(!("Y".equals(isregion))){%>
	    if(isEmpty(regioncode)){
	     alert("<%= message.getMessageDesc("REGION_NOT_NULL")%>");
		 page_selectProvince();
		 return;
		}
   <%}%>
   var url ="";
   if(!isEmpty(__searchvalue)){
	
		 <%if("Y".equals(isadmin)){%>
             //window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
             url="<%=newreportURL %>/xlsrpt?reportname=HospitalSummary&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode));
	     <%}else{%>
	         //window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
	         url="<%=newreportURL %>/xlsrpt?reportname=HospitalSummary&globalpccode=113&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode));
	     <%}%>
    }
	else{
		    <%if("Y".equals(isadmin)){%>
		 		//window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
		 		url="<%=newreportURL %>/xlsrpt?reportname=HospitalSummary&globalpccode=113&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode));
		   	<%}else{%>
		   		//window.open("<%= reportURL %>/servlet/ExcecuteReport/HospitalSummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=113&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
		   		url="<%=newreportURL %>/xlsrpt?reportname=HospitalSummary&globalpccode=113&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode));
		   	<%}%>
		
   }
   url=url+"&timestamp="+Date.parse(new Date())+"&datacategoryval=7";
   DataReport(url);
 
	 
}
	
function batch_export(){
    var employeename=document.__otherSearchConditionForm.employeename.value;
    var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	var regioncode=document.__otherSearchConditionForm.regioncode.value;   
	   <%if(!("Y".equals(isregion))){%>
	    if(isEmpty(regioncode)){
	     alert("<%= message.getMessageDesc("REGION_NOT_NULL")%>");
		 page_selectProvince();
		 return;
		}
        <%}%>
	if(!isEmpty(__searchvalue)){
	 <%if("Y".equals(isadmin)){%>
       window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg113.sox?__format=xlsx&__folder=/ovalreport&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
     <%}else{%>
       window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg113.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
     <%}%>
     }else{
     <%if("Y".equals(isadmin)){%>
      window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg113.sox?__format=xlsx&__folder=/ovalreport&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
     <%}else{%>
      window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg113.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
     <%}%>
     }
     
}
function hosgrade_export(){
    var employeename=document.__otherSearchConditionForm.employeename.value;
    var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	var regioncode=document.__otherSearchConditionForm.regioncode.value;   
	   <%if(!("Y".equals(isregion))){%>
	    if(isEmpty(regioncode)){
	     alert("<%= message.getMessageDesc("REGION_NOT_NULL")%>");
		 page_selectProvince();
		 return;
		}
        <%}%>
    var url ="";
	if(!isEmpty(__searchvalue)){
	 <%if("Y".equals(isadmin)){%>
       //window.open("<%= reportURL %>/servlet/ExcecuteReport/hosgradeupload.sox?__format=xlsx&__folder=/ovalreport&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
       url="<%=newreportURL %>/xlsrpt?reportname=hosgradeupload&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode));
     <%}else{%>
       //window.open("<%= reportURL %>/servlet/ExcecuteReport/hosgradeupload.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode)));
       url="<%=newreportURL %>/xlsrpt?reportname=hosgradeupload&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue))+"&regioncode="+escape(encodeURI(regioncode));
     <%}%>
     }else{
     <%if("Y".equals(isadmin)){%>
      //window.open("<%= reportURL %>/servlet/ExcecuteReport/hosgradeupload.sox?__format=xlsx&__folder=/ovalreport&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
      url="<%=newreportURL %>/xlsrpt?reportname=hosgradeupload&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode));
     <%}else{%>
      //window.open("<%= reportURL %>/servlet/ExcecuteReport/hosgradeupload.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode)));
      url="<%=newreportURL %>/xlsrpt?reportname=hosgradeupload&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+"&regioncode="+escape(encodeURI(regioncode));
     <%}%>
     }
	 url=url+"&timestamp="+Date.parse(new Date())+"&datacategoryval=11,19";
	 DataReport(url);
     
}
function popRep() {
	//var regionid=cform.regionid.value;
	//var proviceofficecode = document.cform.proviceofficelist.value;
	//var businessareacode = document.cform.businessarealist.value;
	var regioncode=document.__otherSearchConditionForm.regioncode.value;
	var status = "height=400, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
	var url = "<%=contextPath%>/masterdata/ogm/RegionSelect.jsp?<%= OvalTools.randomURL() %>&regioncode="+regioncode;
	
	popwindow = window.open(url, "newwindow", status);
  }

function setContact(code,name){
	__otherSearchConditionForm.regioncode.value=code;
	__otherSearchConditionForm.regionname.value=name;
}



var popwindow;

function page_setRegion(code,name)
{
  if(code != document.__otherSearchConditionForm.regioncode.value)
  {
    //document.cform.citycode.value = " ";
    //document.cform.cityname.value = " ";
    //document.cform.countycode.value = " ";
    //document.cform.countyname.value = " ";
  }
  document.__otherSearchConditionForm.regioncode.value= code;
  document.__otherSearchConditionForm.regionname.value = name;
  if (popwindow != null)
    popwindow.close();
}

function page_selectProvince()
{
  if(popwindow!=null)
    popwindow.close();
  popwindow = window.open('<%=contextPath %>/masterdata/ogm/RegionSelect.jsp?<%= OvalTools.randomURL() %>&languagecode=<%= strLanguageCode %>&countrycode=CN','newwindow', 'height=250, width=500,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no');
}
</script>  
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<% 
	String maninTabName = label.getLabelName("L_BasicInfo");
	String str = label.getLabelName("L_ThreeRelationship");
	String str1 = label.getLabelName("L_ProdGrading");
	String str3=label.getLabelName("L_PriceInfo");
	String str4=label.getLabelName("L_AttrInfo");
%>
 
<dcms:summary id="erm.zylhospitalsummary" summaryDataName="hospitalsummary" needNew="true" newTabID="mainTab" editTabID="mainTab" needEdit="true">
	<dcms:param name="userid" property="session:userinfo.userid"/>
	<dcms:param name="pivot1" property="pivotinfo1.pivot1"/>
    <dcms:param name="pivot2" property="pivotinfo1.pivot2"/>
	<dcms:summaryTab id="mainTab" name="<%= maninTabName %>"  href="/phap/masterdata/erm/HospitalEdit.jsp"/> 
	<dcms:summaryTab id="attributeTab" name="<%=str %>"  href="/zyl/masterdata/erm/ZylMasterdataRelationship.jsp?globalpccode=113"/>
	<dcms:summaryTab id="attTab" name="<%=str4 %>"  href="/masterdata/ogm/OrgEditOther.jsp"/>
	<dcms:summaryTab id="prodGroupTab" name="<%=str1 %>"  href="/phap/masterdata/erm/HospitalProductGroup.jsp"/> 
	<dcms:summaryTab id="priceTab" name="<%=str3%>"  href="/masterdata/ogm/ZylOrgPriceInfo.jsp"/>
	<dcms:summaryAction actionFuction="__export('XLSXQ')" labelCode="L_ALL_Execcd" styleWidth="70" privilegeCode="MB-YY03"/>
	<dcms:summaryAction actionFuction="page_export" labelCode="L_Upload_Derived" styleWidth="70" privilegeCode="MB-YY04"/>
    <dcms:summaryAction actionFuction="hosgrade_export" labelCode="L_HospitalLevelExport" styleWidth="100" privilegeCode="MB-YY05"/>
    <dcms:summaryAction actionFuction="batch_export" labelCode="L_HospitalBatchExport" styleWidth="100" privilegeCode="MB-YY06"/>
 <dcms:otherSearchCondition>
   <iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
     <table width="100%" cellspacing="0" cellpadding="0" border="0">
     <tr style="text-align:left"><td style="text-align:left"><%= label.getLabelName("L_EmployeeName") + label.getLabelName("L_Colon") %>
             <custom:text  property="employeename" size="30"/>
              </td>
			</tr>
			<tr style="text-align:left" ><td class="text-align:left"><%=label.getLabelName("L_Province") +  label.getLabelName("L_Colon") %>
				<!-- <td style="width:150px;" class="text-align:left"> -->
					<custom:text property="regionname" 
					size="20" readonly="false" style="border:1px #7F9DB9 solid;" /> <a
					onClick="javascript:popRep();"><custom:button type="3"
					label="L_Asterisk" imgsrc="flash.gif" border="0" /></a><custom:hidden property="regioncode" /></td>
					</tr>
        </table>
  </dcms:otherSearchCondition>  
</dcms:summary>


</body>
<script>
  document.getElementById("__searchvalue").onkeydown=function seachKeyDown()
  {
   // alert(event.keyCode);
    if(event.keyCode==13)
    {
      __summaryGo(document.getElementById("__summaryConfigID").value,document.getElementById("__indicatorImagePath").value,document.getElementById("__summaryRootPath").value,'');
    }
  }
</script> 
</html>